home *** CD-ROM | disk | FTP | other *** search
- Path: news.ping.at!site73!mgeramb
- Newsgroups: comp.lang.c++
- Message-ID: <41@site73.site73.ping.at>
- Reply-To: mgeramb@site73.site73.ping.at (Michael Geramb)
- From: mgeramb@site73.site73.ping.at (Michael Geramb)
- Date: Thu, 25 Jan 1996 08:48:52 GMT
- Subject: Template casting problem
-
- Here is a C++ problem that I never managed to solve.
-
- Imagine you create a template of a class :
-
- template <class T> class A
- {
- ...
- };
-
- This gives a family of classes (instances), say:
-
- A<short>, A<int>, A<float> etc, which may coexist in one function.
- Then, a problem arises how to cast one instance to another.
-
- As a more concrete example, one may imagine a template CVector which
- generates short, integer, float and double instances.
- It also generates a very natural (to my mind) wish to cast
- one instance to another.
-
-
- Vassili
-
-
-